package com.hospital.controller;


import com.hospital.configure.Result;
import com.hospital.entity.CaseInfo;
import com.hospital.entity.Registered;
import com.hospital.service.CaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author WuLiting
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/caseInfo")
public class CaseInfoController {

    @Autowired
    CaseInfoService caseInfoService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateCaseInfo")
    public Result<CaseInfo> updateCaseInfo(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.updateCaseInfo(caseInfo);
    }

    /**
     * 删除
     */
    @RequestMapping("/delCaseInfo")
    public Result<CaseInfo> delCaseInfo(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.delCaseInfo(caseInfo);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelCaseInfo")
    public Result<CaseInfo> batchDelCaseInfo(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.batchDelCaseInfo(caseInfo);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryCaseInfo")
    public Result<CaseInfo> queryCaseInfo(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.queryCaseInfo(caseInfo);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/queryCaseInfoByPage")
    public Result queryCaseInfoByPage(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.queryCaseInfoByPage(caseInfo);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryCaseInfoById")
    public Result<CaseInfo> queryCaseInfoById(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.queryCaseInfoById(caseInfo);
    }

    /**
     * 根据医生ID查询挂号病人
     */
    @RequestMapping("/queryRegisteredUserByDoctorId")
    public Result<Registered> queryRegisteredUserByDoctorId(@RequestBody Registered registered) {
        return caseInfoService.queryRegisteredUserByDoctorId(registered);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/caseInfoPay")
    public Result<CaseInfo> caseInfoPay(@RequestBody CaseInfo caseInfo) {
        return caseInfoService.caseInfoPay(caseInfo);
    }

}

